import { RouteRecordRaw } from 'vue-router'
import { CarSide, FileContract } from '@vicons/fa'
import { CodepenCircleFilled, UnorderedListOutlined } from '@vicons/antd'
import { renderIcon } from '@/util'
import { RequestPageFilled, SupervisedUserCircleRound } from '@vicons/material'
import { SummaryKpi } from '@vicons/carbon'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/biz',
        name: 'biz',
        redirect: '/biz/summary',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '业务管理',
            icon: renderIcon(CodepenCircleFilled),
            role: 'Dev,Adm',
            sort: 1,
        },
        children: [
            {
                path: 'summary',
                name: 'biz.summary',
                meta: {
                    title: '业务统计',
                    icon: renderIcon(SummaryKpi),
                    role: 'Adm',
                },
                component: () => import('@/views/biz/summary/Index.vue'),
            },
            {
                path: 'car',
                name: 'biz.car',
                meta: {
                    title: '车辆信息',
                    icon: renderIcon(CarSide),
                    role: 'Adm',
                },
                component: () => import('@/views/biz/car/Index.vue'),
            },
            {
                path: 'customer',
                name: 'biz.customer',
                meta: {
                    title: '客户信息',
                    icon: renderIcon(SupervisedUserCircleRound),
                    role: 'Adm',
                },
                component: () => import('@/views/biz/customer/Index.vue'),
            },
            {
                path: 'order',
                name: 'biz.order',
                meta: {
                    title: '订单信息',
                    icon: renderIcon(UnorderedListOutlined),
                    role: 'Adm',
                },
                component: () => import('@/views/biz/order/Index.vue'),
            },
            {
                path: 'contract',
                name: 'biz.contract',
                meta: {
                    title: '合同信息',
                    icon: renderIcon(FileContract),
                    role: 'Adm',
                },
                component: () => import('@/views/biz/contract/Index.vue'),
            },
            {
                path: 'wxapp',
                name: 'biz.wxapp',
                meta: {
                    title: '专属小程序申请',
                    icon: renderIcon(RequestPageFilled),
                    role: 'Adm',
                },
                component: () => import('@/views/goods/wxapp/Index.vue'),
            },
        ],
    },
]

export default routes
